/**
 * Copyright© 2003-2019 浙江汇信科技有限公司, All Rights Reserved. <br/>
 */
package com.icinfo.cloud.provider.punish.ucase.punishinform.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.icinfo.cloud.provider.punish.ucase.punishinform.vo.CaseCollectiveDiscussUserVo;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * 描述:  case_collective_discuss_person 对应的实体类.<br>
 * WARNING：不是表中字段的属性必须加@Transient注解
 * @author framework generator
 * @date 2022年12月06日
 */
@Data
@Table(name = "upcase.case_collective_discuss_person")
public class CaseCollectiveDiscussPerson implements Serializable {
    /**
     * 主键id
     */
    @Id
    @Column(name = "id")
    private String id;

    /**
     * 案件id
     */
    @Column(name = "case_id")
    private String caseId;

    /**
     * 用户id
     */
    @Column(name = "user_id")
    private String userId;

    /**
     * 用户名称
     */
    @Column(name = "user_name")
    private String userName;

    /**
     * 用户类型1:主持人,2:出席人员,3:列席人员,4:汇报人员,5:记录人员
     */
    @Column(name = "user_type")
    private String userType;

    /**
     * 机构编码
     */
    @Column(name = "org_code")
    private String orgCode;

    /**
     * 机构名称
     */
    @Column(name = "org_name")
    private String orgName;

    /**
     * 部门编码
     */
    @Column(name = "dept_code")
    private String deptCode;

    /**
     * 部门名称
     */
    @Column(name = "dept_name")
    private String deptName;

    /**
     * 状态；1 有效,0 无效'
     */
    @Column(name = "status")
    private String status;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    /**
     * 议案建议
     */
    @Column(name = "proposal")
    private String proposal;

    /**
     * 发表议案建议时间时间
     */
    @Column(name = "proposal_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date proposalTime;

    /**
     * 手机号
     */
    @Column(name = "tel")
    private String tel;
    /**
     * 发表议案建议时间时间
     */
    @Column(name = "sign_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date signTime;

    /**
     * 签字确认图片
     */
    @Column(name = "sign_url")
    private String signUrl;
    /**
     * 签字确认状态0:未签字,1已签字
     */
    @Column(name = "sign_status")
    private String signStatus;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object target) {
        if (this == target) {
            return true;
        }
        if (target == null || getClass() != target.getClass()) {
            return false;
        }
        CaseCollectiveDiscussPerson student = (CaseCollectiveDiscussPerson) target;
        if(StringUtils.isBlank(student.getUserId()) || StringUtils.isBlank(this.getUserId())){
            return false;
        }
        return student.getUserId().equals(this.getUserId());
    }
    @Override
    public int hashCode() {
        return Objects.hash(userId);
    }

    @Override
    public String toString() {
        return "CaseCollectiveDiscussPerson{" +
                "id='" + id + '\'' +
                ", caseId='" + caseId + '\'' +
                ", userId='" + userId + '\'' +
                ", userName='" + userName + '\'' +
                '}';
    }
}